import type { RouteLocationRaw, Router } from 'vue-router'
import { useRouter } from 'vue-router'

/**
 * page switch
 */
export function useGoPage() {
  const { push, replace } = useRouter()
  function goPage(opt: RouteLocationRaw, isReplace = false) {
    isReplace ? replace(opt) : push(opt)
  }
  return goPage
}
